package com.bee.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bee.user.common.domain.UserDO;
import org.apache.ibatis.annotations.*;

/**
 * @author Damin.yang
 * @date 2019/08/16 17:39
 */
@Mapper
public interface UserMapper extends BaseMapper<UserDO> {

    String COLUMN = "id, username, name, phone, password, salt, sex, address, " +
            "head_img_url, enable, type, last_login_ip, login_times, last_login_time, " +
            "create_time, creator, update_time, updator, delete_time";

    /**
     * 根据用户名或手机号查找用户
     * @param uname
     * @return
     */
    @Select("select " + COLUMN + " from user where username = #{uname} or phone = #{uname}")
    UserDO queryByUsernameOrPhone(@Param("uname") String uname);


}
